<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>

<%@ page import="com.conversationboard.config.*" %>
<%@ page import="com.conversationboard.model.StyleSheets"%>

<%@ page pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8"%>

<%@ page import="com.conversationboard.view.MainMenu"%>
<html>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
		<title>Sockpuppets</title>
		<link rel="stylesheet"title="Conversation Board" type="text/css" href="<%=Configuration.getInstance().getRoot()%>/Stylesheets/<%=StyleSheets.getStyleSheetFileName(request.getCookies())%>">
	</head>

	<body>
	
		<%= MainMenu.display(request.getUserPrincipal()) %>
	
		<div class="headingblock">
			<h1>Sockpuppets</h1>
		</div>

		<div class="mainblock">

			<h2>Password Sockpuppets</h2>

			<p>Each table is a list of the users registered with the same password. It's possible that a given grouping is just
			   people using a very common password.</p>

			<c:forEach var="list" items="${passwordSockpuppets}">
				<table class="table">
					
					<tr class="header">
						<td class="cell">Display Name</td>
						<td class="cell">LoginID</td>
						<td class="cell">Creation Date</td>
						<td class="cell">Last Logged In</td>
						<td class="cell" title="Users are deleted after six months of inactivity. Setting this will ensure the user is never deleted">Don't Delete User</td>
					</tr>			
				
					<c:forEach var="user" items="${list}">
						<tr class="row">
							<td class="cell" style="width: 300px">${user.displayName}</td>
							<td class="cell" style="width: 300px">${user.loginId}</td>
							<td class="cell" style="width: 150px">${user.creationDateString}</td>
							<td class="cell" style="width: 150px">${user.lastLoggedInString}</td>
							<td class="cell" style="width: 150px"><c:if test="${not user.permanent}"><a href="<%=Configuration.getInstance().getRoot()%>/Pages/Admin/confirm.jsp?action=setuserpermanent&loginId=${user.loginId}">Make User Permanent</a></c:if></td>
						</tr>
					</c:forEach>					
				</table>
				
				<br />
				
			</c:forEach>

			<%--
			<h2>IP Address Sockpuppets</h2>

			<c:forEach var="list" items="${ipAddressSockpuppets}">
				<table class="table">
					
					<tr class="header">
						<td class="cell">Display Name</td>
						<td class="cell">LoginID</td>
						<td class="cell">Creation Date</td>
						<td class="cell">Last Logged In</td>
					</tr>			
				
					<c:forEach var="user" items="${list}">
						<tr class="row">
							<td class="cell" style="width: 300px">${user.displayName}</td>
							<td class="cell" style="width: 300px">${user.loginId}</td>
							<td class="cell" style="width: 150px">${user.creationDate}</td>
							<td class="cell" style="width: 150px">${user.lastLoggedIn}</td>
						</tr>
					</c:forEach>					
				</table>
				
				<br />
				
			</c:forEach>
			--%>
			
		</div>

		<!--<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>-->
		<!--<script type="text/javascript">_uacct = "UA-1148679-1";urchinTracker();</script>--> 
		
	</body>
	
</html>
